package com.qf.fmall2202.exception;

import com.qf.fmall2202.vo.ResultVo;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

@ControllerAdvice
public class GlobalExHandler {
    @ExceptionHandler(QfException.class)
    public ResultVo qfExceptionHandler(QfException qfe) {
        qfe.printStackTrace();
        return ResultVo.error(qfe.getMsg());
    }
    @ExceptionHandler(Exception.class)
    public ResultVo qfExceptionHandler(Exception e) {
        e.printStackTrace();
        return ResultVo.error(e.getMessage());
    }
}
